package com.u8.sdk;

import com.u8.sdk.U8SDK;
import com.u8.sdk.UserExtraData;
import com.u8.sdk.plugin.U8User;

import android.app.Activity;
import android.util.Log;

public class MYUser extends U8UserAdapter {

	private Activity context;
	private static final String TAG = MYUser.class.getSimpleName();

	public MYUser(Activity context) {
		this.context = context;
		this.initSDK();
	}

	public void initSDK() {
		MYSDK.getInstance().initSDK(this.context,
				U8SDK.getInstance().getSDKParams());
		// 一些设置 是否有退出框 exit
		// 是否有用户中心 showAccountCenter
		// 是否能登出 logout
		U8User.getInstance().setSupport("logout", true);
		U8User.getInstance().setSupport("showAccountCenter", true);
		U8User.getInstance().setSupport("exit", true);
		U8User.getInstance().setSupport("submitExtraData", true);
	}

	@Override
	public void login() {
		MYSDK.getInstance().login(this.context);
	}

	public void logout() {
		MYSDK.getInstance().logout();
	}

	/*
	 * @Override public boolean showAccountCenter() { // TODO Auto-generated
	 * method stub SYSDK.getInstance().showAccountCenter(); return true; }
	 */

	@Override
	public void submitExtraData(UserExtraData extraData) {
		MYSDK.getInstance().submitExtendData(extraData);
	}

	@Override
	public void exit() {
		MYSDK.getInstance().sdkExit(this.context);
	}

	@Override
	public void switchLogin() {
		MYSDK.getInstance().logout();
		MYSDK.getInstance().login(context);
	}
}
